import {defineConfig} from "vite";
import uni from "@dcloudio/vite-plugin-uni";
import UniComponents from "@uni-helper/vite-plugin-uni-components";
import {NutResolver} from "nutui-uniapp";
// https://vitejs.dev/config/
export default defineConfig({
    define: {},
    plugins: [
        UniComponents({
            resolvers: [NutResolver()],
        }),
        uni(),
    ],
    resolve: {
        alias: {
            '@': '/src',
        },
    },
    css: {
        preprocessorOptions: {
            scss: {
                additionalData: `@import "@/uni.scss";`
            }
        }
    },
    devServer: {
        historyApiFallback: true,
        allowedHosts: "all",
        proxy: {
            "/api": {
                // 需要被代理的后台地址
                //target: "http://192.168.0.25:8080",
                target: "http://e6txzk.natappfree.cc",
                changeOrigin: true,
                secure: false,
                pathRewrite: {
                    "^/api": "",
                },
            },
        },
        client: {
            overlay: false,
        },
    },
});
